/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package homebudget;

import java.awt.Graphics;
import java.awt.Panel;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

/**
 *
 * @author KriT
 */
class ShowImage extends Panel {

    private BufferedImage image = null;

    public ShowImage() {
        try {
            //System.out.println("Enter image name\n");
            //BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
            //String imageName = bf.readLine();
            File input = new File("chart.png");
            image = ImageIO.read(input);
        } catch (IOException ie) {
            System.out.println("Error:" + ie.getMessage());
        }
    }

    public void paint(Graphics g) {
        //draw the image

        if (image != null) {

            g.drawImage(image, 0, 0, this);
        }
    }
}
